-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix HTTPUpdate flash size check and add SPIFFS size check #2161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…_rxBuffer is not initialised
@@ -366,6 +379,10 @@ bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command) | |||
} | |||
} | |||
|
|||
// To do: the SHA256 could be checked if the server sends it | |||
|
|||
delay(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing...
} else { | ||
if(len > (int) ESP.getFreeSketchSpace()) { | ||
log_e("FreeSketchSpace to low (%d) needed: %d\n", ESP.getFreeSketchSpace(), len); | ||
const esp_partition_t* _partition = esp_ota_get_next_update_partition(NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move this logic to Esp.cpp and replace the one in ESP.getFreeSketchSpace
. What is currently there makes no sense for any use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving to ESP.cpp, replacing getFreeSketchSpace() with new code, in HTTUpdate.cpp calling getFreeSketchSpace() again.
Nice :) thanks! |
You're welcome! :) |
HTTPUpdate checked if the new sketch would fit into the current partition free space, which was wrong. Now it checks if it fits into the next flash partition.
A size check for a SPIFFS update is added, this was stil 'to do' from the previous PR.
Still to do: the SHA256 hash could be checked if a server sends it in the request header.
This PR includes PR #2155.